<html>
<head>
<#include "/common/common2.ftl"/>
<link rel="stylesheet" href="/js/plugins/codemirror/codemirror.css" />
<script src="/js/plugins/codemirror/codemirror.js"></script>
<!-- 基本JS 结束 -->
<link rel="stylesheet" href="/js/plugins/codemirror/theme/eclipse.css" />
<!-- 代码折叠 -->
<link rel="stylesheet"
	href="/js/plugins/codemirror/addon/fold/foldgutter.css" />
<script src="/js/plugins/codemirror/addon/fold/foldcode.js"></script>
<script src="/js/plugins/codemirror/addon/fold/foldgutter.js"></script>
<script src="/js/plugins/codemirror/addon/fold/brace-fold.js"></script>
<script src="/js/plugins/codemirror/addon/fold/comment-fold.js"></script>
<!-- 各种语言样式 -->
<script src="/js/plugins/codemirror/mode/javascript/javascript.js"></script>
<script src="/js/plugins/codemirror/mode/clike/clike.js"></script>
<script src="/js/plugins/codemirror/mode/xml/xml.js"></script>
<script src="/js/plugins/codemirror/mode/sql/sql.js"></script>
<!-- 各种语言样式end -->
<script src="/js/plugins/codemirror/addon/edit/matchbrackets.js"></script>
<link rel="stylesheet"
	href="/js/plugins/codemirror/addon/hint/show-hint.css">
<script src="/js/plugins/codemirror/addon/hint/show-hint.js"></script>
</head>
<body>
	<div id="rrapp" v-cloak>
		<div v-show="showList">
			<div class="m-b-md">
				<form class="layui-form-layui-form-pane" role="form" id="searchForm"
					name="searchForm">
					<div class="layui-form-item">
						<!--	<label class="layui-form-label">角色名:</label>
						<div class="layui-input-inline">
							<input type="text" name="name" id="name" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
						</div>-->
						<label class="layui-form-label">框架:</label>
						<div class="layui-input-inline">
							<select name="styleid" id="styleid" class="layui-input">
								<option v-for=" item in allstyle" :value="item.id">
									{{item.name}}</option>

							</select>
						</div>

						<a href="javascript:void(0)" @click="reload"
							class="layui-btn layui-btn-normal" id="search">查询</a>
						<button type="button" @click="del"
							class="layui-btn layui-btn-danger">删除</button>
						<button type="button" @click="add"
							class="layui-btn layui-btn-normal">新增</button>
						<button type="button" @click="update"
							class="layui-btn layui-btn-normal">编辑</button>
					</div>
				</form>
			</div>
			<div class="table-responsive">
				<table class="layui-hide" id="genTemptable"></table>
			</div>
		</div>
		<div v-show="!showList" class="panel panel-default">
			<div class="panel-heading">{{title}}</div>
			<form class="layui-form-layui-form-pane">
				<div class="panel-body">
					<div class="layui-form-item">
						<label class="layui-form-label">描述</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input"
								v-model="genTemp.description" placeholder="描述" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">文件名称</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input"
								v-model="genTemp.genfilename" placeholder="文件名称" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">是否启用</label>
						<div class="layui-input-block">
							<select v-model="genTemp.state" class="layui-input" required
								lay-verify="required">
								<option value="1">启用</option>
								<option value="0">停用</option>
							</select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">所属框架</label>
						<div class="layui-input-block">

							<select v-model="genTemp.styleid" class="layui-input" required
								lay-verify="required">
								<option v-for=" item in allstyle" :value="item.id">
									{{item.name}}</option>

							</select>

						</div>
					</div>


					<div class="layui-form-item">
						<label class="layui-form-label">代码模板</label>
						<div class="layui-input-block">


							<textarea rows="20" cols="120" id="gencontext"
								v-model="genTemp.gencontext">{{genTemp.gencontext}}</textarea>
							<br>
						<font color="red">下面只是个例子</font> 
							<div id="template" style="height: 200px; overflow: scroll;"></div>
						</div>
					</div>

				</div>
				<footer class="panel-footer text-right bg-light lter">
					<div class="layui-form-item">
						<input type="button" class="layui-btn layui-btn-normal"
							@click="saveOrUpdate" value="确定" /> &nbsp;&nbsp; <input
							type="button" class="layui-btn layui-btn-danger" @click="reload"
							value="返回" />
					</div>
				</footer>
			</form>
		</div>
	</div>
	<script src="/js/system/gen/gentemp.js?_=2"></script>
	<script type="text/javascript">
		//根据DOM元素的id构造出一个编辑器
	</script>
</body>
</html>
